<?php 
namespace app\admin\validate;
use think\Validate;

class Links extends Validate
{
    protected $rule = [
        'linkname' => 'require|max:30',
        'interlink'=> 'require|url',
        'linkname' => 'unique:link',
        'interlink' => 'unique:link'

    ];

    protected $message = [
        'interlink.url' => '输入的不是有效的链接',
        'interlink.require' => '链接地址不能为空',
        'linkname.require' => '站点名不能为空',
        'linkname.max' => '名称最多为30个字',
        'linkname.unique' => '站点已存在',
        'interlink.unique' => '链接已存在',
    ];
}